Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish Mirror Function #27

Merged
merged 7 commits into from
Jun 12, 2024
Merged

Conversation

mubarak23
Copy link
Collaborator

Work on issue: #23

  • implement the mirror function from publish contract
  • write the unit test for the function

@codeWhizperer
Copy link
Collaborator

GM @mubarak23, could you add more test cases for the mirror function?

@mubarak23
Copy link
Collaborator Author

GM @mubarak23, could you add more test cases for the mirror function?

i can add
should_panic test,

@codeWhizperer
Copy link
Collaborator

GM @mubarak23, could you add more test cases for the mirror function?

i can add should_panic test,

@mubarak23 test for the pointed_profile_address and root_profile_address and also test for two or more user mirroring a post

Copy link
Collaborator

@Darlington02 Darlington02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a few typo corrections

src/publication/publication.cairo Outdated Show resolved Hide resolved
src/publication/publication.cairo Outdated Show resolved Hide resolved
tests/test_publication.cairo Outdated Show resolved Hide resolved
tests/test_publication.cairo Outdated Show resolved Hide resolved
@mubarak23
Copy link
Collaborator Author

GM @mubarak23, could you add more test cases for the mirror function?

i can add should_panic test,

@mubarak23 test for the pointed_profile_address and root_profile_address and also test for two or more user mirroring a post

can you please explain further what you mean by this

test for the pointed_profile_address and root_profile_address

@codeWhizperer
Copy link
Collaborator

GM @mubarak23, could you add more test cases for the mirror function?

i can add should_panic test,

@mubarak23 test for the pointed_profile_address and root_profile_address and also test for two or more user mirroring a post

can you please explain further what you mean by this

test for the pointed_profile_address and root_profile_address

The pointed_profile_address is the profile that mirrored a post, and the root_profile_address is the profile_address of the user who created the post. So basically, you should test for the root_profile_address of the post being mirrored and the address that mirrored the post pointed_profile_address to ensure the values are correct in storage.

@codeWhizperer
Copy link
Collaborator

GM @mubarak23, could you add more test cases for the mirror function?

i can add should_panic test,

@mubarak23 test for the pointed_profile_address and root_profile_address and also test for two or more user mirroring a post

can you please explain further what you mean by this
test for the pointed_profile_address and root_profile_address

The pointed_profile_address is the profile that mirrored a post, and the root_profile_address is the profile_address of the user who created the post. So basically, you should test for the root_profile_address of the post being mirrored and the address that mirrored the post pointed_profile_address to ensure the values are correct in storage.

@mubarak23 Do you understand?

@mubarak23
Copy link
Collaborator Author

GM @mubarak23, could you add more test cases for the mirror function?

i can add should_panic test,

@mubarak23 test for the pointed_profile_address and root_profile_address and also test for two or more user mirroring a post

can you please explain further what you mean by this
test for the pointed_profile_address and root_profile_address

The pointed_profile_address is the profile that mirrored a post, and the root_profile_address is the profile_address of the user who created the post. So basically, you should test for the root_profile_address of the post being mirrored and the address that mirrored the post pointed_profile_address to ensure the values are correct in storage.

@mubarak23 Do you understand?

Yes

@mubarak23
Copy link
Collaborator Author

@codeWhizperer two or more users mirroring a post test has been added

src/interfaces/IPublication.cairo Outdated Show resolved Hide resolved
src/publication/publication.cairo Outdated Show resolved Hide resolved
tests/test_publication.cairo Outdated Show resolved Hide resolved
src/publication/publication.cairo Show resolved Hide resolved
@Darlington02
Copy link
Collaborator

@mubarak23 left some extra comments, once addressed should be good to go.

@mubarak23
Copy link
Collaborator Author

changes made base on the review requested @Darlington02 kindly review

@Darlington02 Darlington02 merged commit 8ebfa87 into horuslabsio:main Jun 12, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants